package mvc.library.impl;

import java.util.List;

import mvc.core.impl.MachuImage;
import mvc.library.ILibrary;

import com.google.inject.Inject;

public class LibraryHandler {

	private ILibrary library;
	
	
	@Inject
	public LibraryHandler(ILibrary library){
		
		this.library = library;
		
	}
	
	public void addImages(List<MachuImage> list){
		for(MachuImage i : list){
			addImage(i);
		}
		
	}
	
	public void addImage(MachuImage img){	
		library.add(img);
	}
	
	
	public void removeImages(List<MachuImage> list){
		for(MachuImage i : list){
			library.remove(i);
		}
		if(library.getImageList().size() > 0 ){
			library.setSelectedImages(library.getImageList());
		}
	}
	public List<MachuImage> getImages(){
		return library.getImageList();
	}
	
	
	public void setSelectedImages(List<MachuImage> list){
		library.setSelectedImages(list);
	}
	
	public List<MachuImage> getSelectedImages(){
		return library.getSelectedImages();
	}
	
}
